5. PlayServ CLI Command Reference
General invocation
The CLI is installed as a global tool with the command:
playserv
(Source: ToolCommandName=playserv in /Users/reaper/PlayServ/playserv-cli/src/PlayServ.Cli/PlayServ.Cli.csproj)
Available commands
Right now the CLI has one command group:
playserv function ...
And two subcommands:
playserv function analyze <path>playserv function deploy <game_id> <path>
function analyze command
Syntax
playserv function analyze <path>
Arguments
path— the path to the project folder to analyze.
What it does
- Recursively searches for
*.csfiles under the provided path. - Finds RPC classes marked with the
[Rpc]attribute. - Validates RPCs and their dependencies.
- Prints the list of files that need to be compiled/deployed.
Output
- On success:
✓ Analysis completed successfully!Files to compile: N- the list of files.
- On failure:
✗ Analysis failed with errors:- the list of validation errors.
Example
playserv function analyze /Users/reaper/PlayServ/MyGameServerCode
function deploy command
Syntax
playserv function deploy <game_id> <path>
Arguments
game_id— the game identifier.path— the path to the project folder to analyze and deploy.
What it does
- Runs the same analysis as
analyze. - If analysis fails:
- exits with code
1.
- exits with code
- If analysis succeeds:
- creates a ZIP with the files to deploy;
- uploads the ZIP to the Deployment API;
- adds the HTTP header
X-Game-Id: <game_id>.
Output
- On success:
✓ Deployment completed!
- On HTTP error:
- logs the status and error details;
- throws an exception:
Deployment upload failed: <StatusCode>.
Example
playserv function deploy game-001 /Users/reaper/PlayServ/MyGameServerCode
Configuring the deploy endpoint
The endpoint is taken from Deployment:ApiEndpoint.
Default value
http://localhost:5000/api/deployments
(See /Users/reaper/PlayServ/playserv-cli/src/PlayServ.Deployment/DeploymentSettings.cs and /Users/reaper/PlayServ/playserv-cli/src/PlayServ.Cli/appsettings.json)
Configuration options
- via
appsettings.json(Deployment.ApiEndpoint); - via host configuration (env vars / args picked up by the builder).
What the analyzer validates
The analyzer doesn’t just search for [Rpc], it validates the code. Core rules:
RPC class
- must be
public; - cannot be
static,abstract,nested, orgeneric.
RPC methods
- no overloads;
- not
static; - not
async void; - return type must be
Result,Result<T>,Task<Result>, orTask<Result<T>>; - parameters cannot use
ref/out/inand cannot be pointers.
Namespace restrictions
Allowed:
SystemSystem.Collections.GenericSystem.LinqSystem.Text
(and sub-namespaces).
Dependency validation
RPC dependencies are also validated as data types (POCO style).
Current implementation notes
- In the deployment ZIP, files are added using only
Path.GetFileName(...):- folder structure is not preserved.
- The authorization token is currently not used for the HTTP upload in this CLI.
- Help can be shown via:
playserv function --helpplayserv function analyze --helpplayserv function deploy --help